#ifndef QD3DCONTEXT_H
#define QD3DCONTEXT_H
#include <d3d11.h>
#include <d3dx11.h>
#include <QObject>

class QD3DContext : QObject
{

	Q_OBJECT

public:

	D3D_DRIVER_TYPE driverType;
	D3D_FEATURE_LEVEL featureLevel;
	ID3D11Device *pDevice;
	ID3D11DeviceContext *pImmediateContext;
	IDXGISwapChain *pSwapChain;
	ID3D11RenderTargetView *pRenderTargetView;
	ID3D11DepthStencilView *pDepthStencilView;
	QD3DContext (HWND hWnd);
	~QD3DContext ();

	static QD3DContext *cur ();
	static void lockCur (QD3DContext *pContext);
	static void releaseCur (QD3DContext *pContext);

private:

	static QD3DContext *_pCurrent;

	LRESULT _initialize (HWND hWnd);
	void _cleanup ();
};

#endif // QD3DCONTEXT_H
